package cn.buk.tms.dao;

import cn.buk.common.sc.CommonSearchCriteria;
import cn.buk.tms.entity.base.Airline;
import cn.buk.tms.entity.base.Airport;
import cn.buk.tms.entity.base.City;
import cn.buk.tms.entity.misc.FareCondition;
import cn.buk.tms.entity.misc.FlightConditionTimeWindow;
import cn.buk.tms.entity.misc.LuggageInfo;
import cn.buk.tms.entity.misc.SubclassInfo;

import java.util.List;

/**
 * Created by yfdai on 2015-3-19.
 */
public interface BasicDataDao {

    /**
     * 通过三字代码获取航班信息
     *
     * @param threeCode
     * @return
     */
    Airport getAirport(String threeCode);

    boolean saveAirport(Airport airport);

    List<Airport> searchAirport(String threeCode);

    List<Airport> searchAirportsByCountry(String countryCode);

    List<Airport> searchAirports(CommonSearchCriteria sc);

    List<Airport> getAllAirports();

    /**
     * 获取所有航空公司信息
     * @return 航空公司信息
     */
    List<Airline> getAllAirlines();

    List<Airline> searchAirlines(String twoCode);

    List<Airline> searchAirlines(CommonSearchCriteria sc);

    int saveAirline(Airline airline);

    List<FareCondition> searchFareCondition(int enterpriseId, String carrier, String subclass);

    int createAirport(Airport airport);

    int updateAirport(Airport airport);

    int createAirlines(Airline airline);

    int updateAirlines(Airline airlines);

    List<SubclassInfo> searchSubclasses(String carrier, String subclass);

    List<SubclassInfo> searchSubclassInfos(int enterpriseId, String carrier);

    List<City> searchCities(CommonSearchCriteria sc);

    int createCity(int enterpriseId, String username, City city);

    int saveFlightConditionTimeWindows(int userId, String carrier, List<FlightConditionTimeWindow> timeWindows);

    int saveLuggageInfo(LuggageInfo info);

    List<LuggageInfo> searchLuggageInfos(int enterpriseId, CommonSearchCriteria sc);

    List<LuggageInfo> searchLuggageInfos(int enterpriseId, String twoCode);
    LuggageInfo getLuggageInfoById(int id);

    List<FlightConditionTimeWindow> searchFlightConditionTimeWindows(final String carrier);
}
